package com.ruoyi.swla2.service.impl;

import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.swla2.mapper.RealtimegatherdataXbMapper;
import com.ruoyi.swla2.domain.RealtimegatherdataXb;
import com.ruoyi.swla2.service.IRealtimegatherdataXbService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
/**
 * 实时数据采集（远传小）Service业务层处理
 * 
 * @author gdqt
 * @date 2025-04-16
 */
@Service
public class RealtimegatherdataXbServiceImpl extends ServiceImpl<RealtimegatherdataXbMapper, RealtimegatherdataXb> implements IRealtimegatherdataXbService
{
    @Autowired
    private RealtimegatherdataXbMapper realtimegatherdataXbMapper;

    /**
     * 查询实时数据采集（远传小）列表
     * 
     * @param realtimegatherdataXb 实时数据采集（远传小）
     * @return 实时数据采集（远传小）
     */
    @Override
    public List<RealtimegatherdataXb> selectRealtimegatherdataXbList(RealtimegatherdataXb realtimegatherdataXb)
    {
        LambdaQueryWrapper<RealtimegatherdataXb> queryWrapper = new LambdaQueryWrapper<>();
        if(realtimegatherdataXb.getID() != null){
            queryWrapper.eq(RealtimegatherdataXb::getID,realtimegatherdataXb.getID());
        }
        if(realtimegatherdataXb.getTotalFlow() != null){
            queryWrapper.eq(RealtimegatherdataXb::getTotalFlow,realtimegatherdataXb.getTotalFlow());
        }
        if(StringUtils.isEmpty(realtimegatherdataXb.getReadDate())){
            queryWrapper.eq(RealtimegatherdataXb::getReadDate,realtimegatherdataXb.getReadDate());
        }
        if(StringUtils.isEmpty(realtimegatherdataXb.getEasIonID())){
            queryWrapper.eq(RealtimegatherdataXb::getEasIonID,realtimegatherdataXb.getEasIonID());
        }
        if(realtimegatherdataXb.getForwardFlow() != null){
            queryWrapper.eq(RealtimegatherdataXb::getForwardFlow,realtimegatherdataXb.getForwardFlow());
        }
        if(realtimegatherdataXb.getReverseFlow() != null){
            queryWrapper.eq(RealtimegatherdataXb::getReverseFlow,realtimegatherdataXb.getReverseFlow());
        }
        if(realtimegatherdataXb.getInstantFlow() != null){
            queryWrapper.eq(RealtimegatherdataXb::getInstantFlow,realtimegatherdataXb.getInstantFlow());
        }
        return realtimegatherdataXbMapper.selectList(queryWrapper);
    }

    /**
     * 新增实时数据采集（远传小）
     * 
     * @param realtimegatherdataXb 实时数据采集（远传小）
     * @return 结果
     */
    @Override
    public int insertRealtimegatherdataXb(RealtimegatherdataXb realtimegatherdataXb)
    {
        return realtimegatherdataXbMapper.insert(realtimegatherdataXb);
    }

}
